package com.example.streamconsumer.highlevel;

import org.springframework.cloud.stream.annotation.Input;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;

/**
 * 消费到source消息，解析出来sms和email消息，并将它们分别发送到指定通道
 *
 * @Author: lihui
 * @Date: 2022-03-23 10:20
 * @Description: 自定义消息通道
 */
public interface MyProcessor {

    String SOURCE_MESSAGE = "source.message";
    String SMS_MESSAGE = "sms.message";
    String EMAIL_MESSAGE = "email.message";

    @Input(SOURCE_MESSAGE)
    SubscribableChannel sourceInput();

    @Output(SMS_MESSAGE)
    MessageChannel smsOutput();

    @Output(EMAIL_MESSAGE)
    MessageChannel emailOutput();

}
